package com.demo.dao;

import java.util.List;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.demo.model.Teacher;

public interface TeacherDao {

	@InsertProvider(type = com.demo.dao.mapper.TeacherMapper.class, method = "insert")
	@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
	public int insert(Teacher teacher);

	@DeleteProvider(type = com.demo.dao.mapper.TeacherMapper.class, method = "delete")
	public Integer delete(long id);
	
	@UpdateProvider(type = com.demo.dao.mapper.TeacherMapper.class, method = "update")
	public Integer update(Teacher teacher);
	
	@SelectProvider(type = com.demo.dao.mapper.TeacherMapper.class, method = "select")
	public List<Teacher> select(@Param("name") String name, @Param("pageNo") int pageNo, @Param("pageSize") int pageSize);
	
	@SelectProvider(type = com.demo.dao.mapper.TeacherMapper.class, method = "count")
	public int count(String name);
	
	@SelectProvider(type = com.demo.dao.mapper.TeacherMapper.class, method = "selectOne")
	public Teacher selectOne(int id);

}
